﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master.master" AutoEventWireup="true"
    CodeFile="ApproalManager.aspx.cs" Inherits="ApproalManager" %>

<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxDataView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2.Linq, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Data.Linq" TagPrefix="dx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="MainContent">
    <h1 class="DemoTitle">
        批文信息管理
    </h1>
    <div id="DemoArea">
        <div class="Spacer" style="height: 14px;">
        </div>
        <dx:LinqServerModeDataSource ID="LinqServerModeDataSource1" runat="server" ContextTypeName="DAL.DataClassesDataContext"
            TableName="Approal" EnableDelete="True" EnableInsert="True" EnableUpdate="True" />
        <dx:ASPxGridView ID="gvShow" runat="server" AutoGenerateColumns="False" Width="100%"
            DataSourceID="LinqServerModeDataSource1" KeyFieldName="ID" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
            CssPostfix="Office2010Blue" OnRowInserting="gvShow_RowInserting" OnRowCommand="gvShow_RowCommand">
            <SettingsText EmptyDataRow="没有记录" />
            <Columns>
                <dx:GridViewDataTextColumn Caption="批文文号" FieldName="Approal_ID" VisibleIndex="0">
                    <PropertiesTextEdit Native="True">
                    </PropertiesTextEdit>
                    <EditFormSettings CaptionLocation="Near" Visible="True" />
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="批文标题" FieldName="Approal_Title" VisibleIndex="1">
                    <PropertiesTextEdit Native="True">
                    </PropertiesTextEdit>
                    <EditFormSettings CaptionLocation="Near" Visible="True" />
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataMemoColumn Caption="批文摘要" FieldName="Approal_Summary" Visible="False"
                    VisibleIndex="2">
                    <PropertiesMemoEdit Height="200px" Native="True" Width="100%">
                    </PropertiesMemoEdit>
                    <EditFormSettings CaptionLocation="Near" ColumnSpan="2" Visible="True" />
                </dx:GridViewDataMemoColumn>
                <dx:GridViewDataTextColumn Caption="批文日期" FieldName="Approal_Date" VisibleIndex="3"
                    Width="70px">
                    <PropertiesTextEdit DisplayFormatString="d">
                    </PropertiesTextEdit>
                    <EditFormSettings CaptionLocation="Near" Visible="True" />
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="批文文件" VisibleIndex="5" Width="150px">
                    <PropertiesTextEdit Native="True">
                    </PropertiesTextEdit>
                    <EditFormSettings CaptionLocation="Near" Visible="False" />
                    <DataItemTemplate>
                        <a href='ApproalUpLoad.aspx?AID=<%#Eval("ID") %>'>上传批文件</a> <a href='FileViewer.aspx?path=<%#Eval("Approal_File") %>'>
                            查看批文文件</a>
                    </DataItemTemplate>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataComboBoxColumn Caption="所属社区" FieldName="ComminityID" VisibleIndex="4"
                    Name="t_Community_ID">
                    <PropertiesComboBox Spacing="0" ValueType="System.String">
                    </PropertiesComboBox>
                    <EditFormSettings CaptionLocation="Near" />
                    <PropertiesComboBox Spacing="0" ValueType="System.String" DataSourceID="datacmdComminity"
                        TextFormatString="{0}" ValueField="Community_ID" TextField="Community_Name">
                    </PropertiesComboBox>
                </dx:GridViewDataComboBoxColumn>
                <dx:GridViewDataTextColumn Caption="操作" VisibleIndex="6" Width="100px">
                    <DataItemTemplate>
                        <a href="ApproalAdd.aspx">添加</a> 
                        <a href='ApproalUpdate.aspx?AID=<%#Eval("ID") %>'>编辑</a>
                        <asp:LinkButton ID="lnkDelete" runat="server">删除</asp:LinkButton>
                    </DataItemTemplate>
                </dx:GridViewDataTextColumn>
            </Columns>
            <SettingsPager PageSize="8">
                <Summary Text="当前第{0}页，共{1}页，{2}条记录" />
            </SettingsPager>
            <Images SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                <LoadingPanelOnStatusBar Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                </LoadingPanelOnStatusBar>
                <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                </LoadingPanel>
            </Images>
            <ImagesFilterControl>
                <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                </LoadingPanel>
            </ImagesFilterControl>
            <Styles CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue">
                <Header ImageSpacing="5px" SortingImageSpacing="5px">
                </Header>
                <LoadingPanel ImageSpacing="5px">
                </LoadingPanel>
            </Styles>
            <StylesPager>
                <PageNumber ForeColor="#3E4846">
                </PageNumber>
                <Summary ForeColor="#1E395B">
                </Summary>
            </StylesPager>
            <StylesEditors ButtonEditCellSpacing="0">
                <ProgressBar Height="21px">
                </ProgressBar>
            </StylesEditors>
        </dx:ASPxGridView>
    </div>
    <asp:SqlDataSource ID="datacmdComminity" runat="server" ConnectionString="<%$ ConnectionStrings:ManagerConnectionString %>"
        SelectCommand="select * from dbo.Community where Community_ID =  RIGHT('00'+CAST(Community_ID AS VARCHAR(2)),2) order by Community_ID">
    </asp:SqlDataSource>
</asp:Content>
